# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  protect_from_forgery # See ActionController::RequestForgeryProtection for details
  
  # Scrub sensitive parameters from your log
  # filter_parameter_logging :password
 
  private
  
  def get_order_item
    session[:order_item] ||= OrderItem.new 
  end
  
  def get_order
    Order.find(session[:order])
  end
  
  def get_position
    Position.find(session[:position])
  end
  
  #清除session中的信息，为下一次的诊断做准备
  def clean_session
    session[:position] = nil
    session[:order_item] = nil
    session[:order] = nil
  end
  
end
